package com.example.demo.widget.chart.utils

import android.graphics.PointF
import kotlin.math.cos
import kotlin.math.sin

/**
 * 数学工具类
 *
 * @author wangheng
 */
object MathUtils {
    /**
     * 得到圆上的点坐标
     */
    fun getPointF(centerX: Float,centerY: Float,radius: Float,angle: Float): PointF {
        val result = PointF()
        result.x = (centerX + radius * cos(Math.toRadians(angle.toDouble()))).toFloat()
        result.y = (centerY + radius * sin(Math.toRadians(angle.toDouble()))).toFloat()
        return result
    }
}